@extends('admin.layouts.master')

@section('content')

<div class="row aw-form aw-form-explore aw-canshu" id="Data-Form" style="display:none;">
	<div class="col-md-12">
		<section class="panel aw-content">
			<header class="panel-heading">网站设置</header>
			<form class="row cmxform form-horizontal tasi-form panel-body">
				<div class="col-lg-12 overflow-hidden">
					<h3 class="panel-heading aw-border-none" style="margin-top:10px;">站点设置</h3>
					<div class="col-lg-12 col-md-12 form-group">
						<label class="control-label col-lg-12">网站名称：</label>
						<div class="col-lg-6">
							<input class="form-control" type="text" placeholder="请输入网站名称" id="title" name="title" v-model="data.title" v-bind:value="data.title">
						</div>
					</div>
					<div class="col-lg-6 col-md-6 form-group">
						<label class="control-label col-lg-12">网站关键词（请勿换行）：</label>
						<div class="col-lg-12">
							<textarea class="form-control" placeholder="请输入网站关键词" id="meta_keywords" name="meta_keywords" v-model="data.meta_keywords" v-bind:value="data.meta_keywords"></textarea>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 form-group">
						<label class="control-label col-lg-12">网站描述（请勿换行）：</label>
						<div class="col-lg-12">
							<textarea class="form-control" placeholder="请输入网站描述" id="meta_description" name="meta_description" v-model="data.meta_description" v-bind:value="data.meta_description"></textarea>
						</div>
					</div>
				</div>
				
				<div class="col-lg-12 overflow-hidden">
					<h3 class="panel-heading aw-border-none">分类设置</h3>
					<div class="col-lg-6 col-md-6 form-group">
                        <label class="control-label col-lg-12">新闻分类：</label>
                        <div class="col-lg-12">
                            <select class="form-control" id="class_news" name="class_news" v-model="data.class_news" v-bind:value="data.class_news">
                            	<option value="">请选择新闻分类</option>
                            	<option v-for="(list,key) in class_list" :value="list.id">@{{list.name}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 form-group">
                        <label class="control-label col-lg-12">招聘部门：</label>
                        <div class="col-lg-12">
                            <select class="form-control" id="class_department" name="class_department" v-model="data.class_department" v-bind:value="data.class_department">
                            	<option value="">请选择招聘部门分类</option>
                            	<option v-for="(list,key) in class_list" :value="list.id">@{{list.name}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 form-group">
                        <label class="control-label col-lg-12">招聘门店：</label>
                        <div class="col-lg-12">
                            <select class="form-control" id="class_store" name="class_store" v-model="data.class_store" v-bind:value="data.class_store">
                            	<option value="">请选择招聘门店分类</option>
                            	<option v-for="(list,key) in class_list" :value="list.id">@{{list.name}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 form-group">
                        <label class="control-label col-lg-12">后台职位：</label>
                        <div class="col-lg-12">
                            <select class="form-control" id="class_admin_join" name="class_admin_join" v-model="data.class_admin_join" v-bind:value="data.class_admin_join">
                            	<option value="">请选择后台职位分类</option>
                            	<option v-for="(list,key) in class_list" :value="list.id">@{{list.name}}</option>
                            </select>
                        </div>
                    </div>
				</div>
				
				<div class="col-lg-12 aw-content-btn">
					<a class="btn btn-gules" href="javascript:;" v-on:click="Save()">保存</a>
					<a class="btn btn-gray" href="/admin/join/list">取消</a>
				</div>
			</form>
		</section>
	</div>
</div>

@section('pagejs')
@parent

<script type="text/javascript">
var Http_id=GetQueryString("id");
var ajax_data={
	api:'/adminapi/system/web-setup-info',
	form_data:{id:Http_id},
	tips:false,
}
var ajax_class_list_data={
	api:'/adminapi/class/class-list',
	form_data:{},
	tips:false,
}
getData(ajax_class_list_data,function(res_vue){
	console.log('---------res_vue')
	console.log(res_vue.res)
	Class_list=res_vue.res
})
var Ajax_Vue_Fun=function(vue_data){
	vm=new Vue({
		el:'#Data-Form',
		data:{
			data:vue_data,
			class_list:Class_list,
		},
		methods:{
			Save:function(){
				console.warn('Vue-fun:保存网站设置 id='+this.data.id);
				console.log(this.data);
				var ajax_data_edit={
					api:'/adminapi/system/web-setup-save',
					form_data:this.data,
					tips:'保存网站设置成功',
				}
				postData(ajax_data_edit)
			}
		}
	})
	console.log(vm)
	$('#Data-Form').fadeIn(0)
}
getData(ajax_data,Ajax_Vue_Fun)
</script>
@endsection

@endsection

